﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="articlelist.aspx.cs" Inherits="Mocola.Net.Web.articlelist" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>CsLand Ams v1.0 - 中新置地档案管理系统</title>
    <meta name="description" content="CsLand Ams v1.0 - 中新置地档案管理系统" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <link rel="stylesheet" href="css/content.css" type="text/css" />
    <link rel="stylesheet" href="css/ui.css" type="text/css" />
    <link rel="stylesheet" href="css/sys.css" type="text/css" />
    <link rel="stylesheet" href="css/table.css" type="text/css" />
    <!--[if IE]>
	    <script type="text/javascript" src="scripts/excanvas-compressed.js"></script>	
        <style type="text/css"> html{ height: 100%; overflow: auto; } </style>	
    <![endif]-->

    <script type="text/javascript" src="scripts/mootools-1.2-core.js"></script>
    <script type="text/javascript" src="scripts/mootools-1.2-more.js"></script>
    <script type="text/javascript" src="scripts/mocha.js"></script>
    <script type="text/javascript" src="scripts/mocola-funs.js"></script>
</head>
<body style="padding:5px">
    <form id="form1" runat="server">
    <table class="mytable" cellspacing="0" summary="菜单栏" style="width: 100%">
        <tr>
            <th scope="row" class="specalt">
                <input id="btnNew" type="button" value="新增文章" class="btnzc" style="width: 100px" onclick="newarticle()" />
            </th>
        </tr>
    </table>
    <div class="dvspec" id="DivArticles" style="margin-top:5px;">
        <div style="padding: 10px; overflow: auto; height:400px">
            <div class="title1">档案管理制度和流程：</div>
            <div>
                <table class="table2" cellspacing="0" style="margin-top: 5px; border: 1px #C1DAD7 solid;width:100%">
                    <tr>
                        <th style="width: 20px">
                            <asp:CheckBox ID="chkArticles_All" runat="server" onclick="ChkAll(this,'DivArticles')" />
                        </th>
                        <th>
                            标题
                        </th>
                        <th style="width: 140px">
                            发布日期
                        </th>
                        <th style="width: 70px">
                            发布者
                        </th>
                        <th style="width: 50px">
                            分类
                        </th>
                        <th style="width: 120px">
                            操作
                        </th>
                    </tr>
            <asp:Repeater ID="rptArticles" runat="server" >
                <ItemTemplate>
                    <tr>
                        <td align="center">
                            <asp:CheckBox ID="chkArticlesItem" runat="server" />
                            <asp:HiddenField ID="hfArticleID" runat="server" />
                        </td>
                        <td>
                            <a href='javascript:view(<%# Eval("ArticleID")%>)'><%# Eval("Title")%></a>
                        </td>
                        <td>
                            <%# Eval("Created")%>
                        </td>
                        <td>
                            <%# Eval("Author")%>
                        </td>
                        <td>
                            <%# Eval("Category")%>
                        </td>
                        <td align="center">
                            <input type="button" class="btnzc" value="编辑" onclick="edit(<%# Eval("ArticleID") %>)" />
                            <input type="button" class="btnzc" value="删除" onclick="if(!confirm('您确定要删除这篇文章吗？')){return false;}else{del(<%# Eval("ArticleID") %>)}" />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
                </table>
        </div>
        <div style="margin-top: 10px;">
            <webdiyer:AspNetPager ID="ppArticles" runat="server" HorizontalAlign="Left" PageSize="6"
                AlwaysShow="true" ShowInputBox="Always" ShowCustomInfoSection="Right" CustomInfoSectionWidth="300px"
                InputBoxStyle="border:1px solid #c8c8c8;" SubmitButtonStyle="border:none;backgroundColor:#F5F5DC;height:19px;"
                BorderColor="#F5F5DC" OnPageChanged="ppArticles_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    </div>
    </form>
    <script type="text/javascript">
        function view(id) {
            alert(id);
        }
        function edit(id) {
            new window.parent.MochaUI.Window({
                id: 'winNewArticle',
                title: '档案管理制度和流程 - 编辑文章',
                loadMethod: 'iframe',
                contentURL: 'newarticle.aspx?ArticleID='+id,
                width: 750,
                height: 450,
                resizable: false
            });
//            window.parent.MochaUI.updateContent({
//			'element': window.parent.$('mainPanel'),
//			'loadMethod': 'iframe',
//			'url': 'newarticle.aspx?ArticleID='+id,
//			'title': '档案管理制度和流程 - 编辑文章',
//			'scrollbars': false,
//			'padding': { top: 0, right: 0, bottom: 0, left: 0 }
//		 });
        }
        function del(id)
        {
            var req = new Request(
            {
                url: 'ajax/DelArticles.aspx?ArticleID=' + id,
                onSuccess: function(txt) {
                    alert("删除文章成功!");
                    location.replace('articlelist.aspx');
                },
                onFailure: function() {
                    alert("删除文章失败!");
                }
            });
            req.send();
        }

        function newarticle() {
            new window.parent.MochaUI.Window({
                id: 'winNewArticle',
                title: '档案管理制度和流程 - 新增文章',
                loadMethod: 'iframe',
                contentURL: 'newarticle.aspx',
                width: 750,
                height: 450,
                resizable: false
            });
//            window.parent.MochaUI.updateContent({
//			'element': window.parent.$('mainPanel'),
//			'loadMethod': 'iframe',
//			'url': 'newarticle.aspx',
//			'title': '档案管理制度和流程 - 新建文章',
//			'scrollbars': false,
//			'padding': { top: 0, right: 0, bottom: 0, left: 0 }
//		 });
        }
    </script>
</body>
</html>
